@{
    Html.EnableClientValidation();
    Html.EnableUnobtrusiveJavaScript();
	var grid = Html.DevExpress().GridView(settings => {
        settings.Name = "GridView";
        settings.CallbackRouteValues = new { Controller = "Menus", Action = "GridViewPartial" };

				settings.SettingsEditing.AddNewRowRouteValues = new { Controller = "Menus", Action = "GridViewPartialAddNew" };
        settings.SettingsEditing.UpdateRowRouteValues = new { Controller = "Menus", Action = "GridViewPartialUpdate" };
        settings.SettingsEditing.DeleteRowRouteValues = new { Controller = "Menus", Action = "GridViewPartialDelete" };
        settings.SettingsEditing.Mode = GridViewEditingMode.EditFormAndDisplayRow;
        settings.SettingsBehavior.ConfirmDelete = true;
        settings.Width = System.Web.UI.WebControls.Unit.Percentage(100); 
        
		settings.CommandColumn.Visible = true;
        settings.CommandColumn.ShowNewButton = true;
        settings.CommandColumn.ShowDeleteButton = true;
        settings.CommandColumn.ShowEditButton = true;

		settings.KeyFieldName = "ID";

		settings.SettingsPager.Visible = true;
		settings.Settings.ShowGroupPanel = true;
		settings.Settings.ShowFilterRow = true;
		settings.SettingsBehavior.AllowSelectByRowClick = true;

				settings.Columns.Add("Name");
				settings.Columns.Add("Description");
                settings.Columns.Add("IsStatus", MVCxGridViewColumnType.CheckBox);
                settings.Columns.Add(column => {
                    column.FieldName = "IsGroup";
                    column.Caption = "Group";
                    column.ColumnType = MVCxGridViewColumnType.CheckBox;
            });
            settings.PreRender = (sender, e) =>
            {
                ((MVCxGridView)sender).StartEdit(1);
            };
		});
		if (ViewData["EditError"] != null){
            grid.SetEditErrorText((string)ViewData["EditError"]);
            
         
        }
        
}
@grid.Bind(Model).GetHtml()